feat(sdk,core,webapp): transcript storage for chat.agent - #4896
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a Merge Risk: 🟡 Moderate · up to This change adds persisted chat transcripts, loading, paging, and recovery behavior. The remaining documentation issues could cause users to implement incompatible action handling or incomplete recovery flows, so they should be corrected before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 47.06% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 17 files. (2 skipped: 2 unsupported.) Full details: Description checkExplanation The description accurately summarizes the feature, implementation scope, and review history, but it does not follow the repository template. It omits the issue reference, checklist, testing steps, changelog, and screenshots sections. ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🦋 Changeset detectedLatest commit: ed95a9e The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Observability mapAs of 19/100 over 457 measured of 475 entry points (base 19, no change) What this PR changed
FIX FIRST
AUDIT 3 of 50 sensitive mutations record an actor. 47 without one. What the score is made ofThe score and findings here are report-only and never gate the merge. Separately, a required test suite keeps this tool's symbol and route lists in sync with the code they name, and can fail a pull request that renames or removes a symbol they reference, or that adds the first route with a segment they anticipate. Each failure names the list to edit. The rules and their reasons: internal-packages/observability-map/README.md. |
c5e1f5d to
bac2a16
Compare
2b2ea99 to
be72173
Compare
@trigger.dev/build
trigger.dev
@trigger.dev/core
@trigger.dev/python
@trigger.dev/react-hooks
@trigger.dev/redis-worker
@trigger.dev/rsc
@trigger.dev/schema-to-json
@trigger.dev/sdk
commit: |
bac2a16 to
bb1acb8
Compare
be72173 to
5dc4365
Compare
bb1acb8 to
8bb1a1c
Compare
5dc4365 to
3bdfd45
Compare
8bb1a1c to
10a1d68
Compare
3bdfd45 to
db561bb
Compare
10a1d68 to
f2a1179
Compare
db561bb to
185360a
Compare
f2a1179 to
860969d
Compare
185360a to
461a6d2
Compare
860969d to
0b4aa77
Compare
461a6d2 to
1a3b477
Compare
0b4aa77 to
b12a0b7
Compare
1a3b477 to
d06408f
Compare
b12a0b7 to
dce7b9b
Compare
d06408f to
a4f1bfe
Compare
39a00da to
bf8496f
Compare
1e23c34 to
d627683
Compare
7a6c3fd to
0a10002
Compare
3ddfb85 to
bca2b92
Compare
d627683 to
8292d10
Compare
8292d10 to
70a6e1d
Compare
af81d57 to
5f06b37
Compare
Give chat.agent a pluggable TranscriptStorage seam so a run can own its conversation history across continuations: the version 2 transcript snapshot and dual-version dashboard reader, the storage option with a read API and conformance suite, run-tail recovery, compaction and injected-context persistence, and a dashboard TranscriptStorage over the agent's message rows. Includes the continuation-boot recovery hardening and the compaction/injection persistence fix. Rebased onto main and migrated to zod v4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VG39FXXkFFU24U5EtJMwPi
5f06b37 to
ed95a9e
Compare
Follow-ups to the transcript storage feature (triggerdotdev#4896), surfaced by dogfooding it in the durable-chat example. ## Changes - **Drop the compaction prefix fingerprint.** A compacted lane is reused while its `throughId` still exists in the transcript. A rollback that crosses the compaction point rebuilds from the transcript; an in-place edit of a summarized message is tolerated (unsupported by design). This removes the implicit requirement that a custom `TranscriptStorage` preserve exact message JSON — no more "store as TEXT not JSONB / canonicalize keys" trap. - **Skip persisting a content-less assistant response.** A turn that errors before the model writes anything no longer leaves an empty assistant bubble in the transcript or the next turn's context. - **Non-empty error fallback.** A thrown error with no message now surfaces a generic message instead of a blank error to the client. - **Test harness:** `seedSessionInTail` stamps the harness `clientData` onto seeded records (matching how production carries each record's metadata), so recovery re-dispatch is testable for `clientDataSchema` agents. ## Verification - `@trigger.dev/sdk` + `@trigger.dev/core` typecheck clean - Full `@trigger.dev/sdk` suite: 633 passing (includes new tests for the throughId-boundary compaction behavior, the empty-response skip, and clientData-scoped recovery re-dispatch) - oxfmt + oxlint clean --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Adds a pluggable
TranscriptStorageseam so achat.agentrun can own its conversation history across continuations:chat.agentTranscriptStorageover the agent's message rowsThis collapses the former 5-PR review stack (#4904, #4893, #4894, #4895) into a single PR after rebasing onto main and migrating to zod v4 (the stack was on zod v3 and conflicted with the zod v4 upgrade #4039). All prior review threads were addressed on the stack branches.
🤖 Generated with Claude Code